

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>warp_drive.training.algorithms package &mdash; WarpDrive 1.0 documentation</title>
  

  
  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="https://assets.readthedocs.org/static/css/badge_only.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/doctools.js"></script>
        <script async="async" src="https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"></script>
    
    <script type="text/javascript" src="_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="warp_drive.training.models package" href="warp_drive.training.models.html" />
    <link rel="prev" title="warp_drive.training package" href="warp_drive.training.html" /> 

<!-- RTD Extra Head -->

<link rel="stylesheet" href="https://assets.readthedocs.org/static/css/readthedocs-doc-embed.css" type="text/css" />

<script type="application/json" id="READTHEDOCS_DATA">{"ad_free": "", "api_host": "", "build_date": "2021-08-31T22:53:14Z", "builder": "sphinx", "canonical_url": "", "commit": "", "docroot": "", "features": {"docsearch_disabled": false}, "global_analytics_code": null, "language": "", "page": "warp_drive.training.algorithms", "programming_language": "", "project": "", "source_suffix": ".rst", "subprojects": {}, "theme": "", "user_analytics_code": null, "version": ""}</script>

<!--
Using this variable directly instead of using `JSON.parse` is deprecated.
The READTHEDOCS_DATA global variable will be removed in the future.
-->
<script type="text/javascript">
READTHEDOCS_DATA = JSON.parse(document.getElementById('READTHEDOCS_DATA').innerHTML);
</script>

<script type="text/javascript" src="https://assets.readthedocs.org/static/javascript/readthedocs-analytics.js" async="async"></script>

<!-- end RTD <extrahead> -->
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="index.html" class="icon icon-home"> WarpDrive
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="warp_drive.html">warp_drive package</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="warp_drive.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="warp_drive.managers.html">warp_drive.managers package</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="warp_drive.training.html">warp_drive.training package</a><ul class="current">
<li class="toctree-l4 current"><a class="reference internal" href="warp_drive.training.html#subpackages">Subpackages</a></li>
<li class="toctree-l4"><a class="reference internal" href="warp_drive.training.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="warp_drive.training.html#warp-drive-training-example-training-script-module">warp_drive.training.example_training_script module</a></li>
<li class="toctree-l4"><a class="reference internal" href="warp_drive.training.html#module-warp_drive.training.trainer">warp_drive.training.trainer module</a></li>
<li class="toctree-l4"><a class="reference internal" href="warp_drive.training.html#module-warp_drive.training">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="warp_drive.utils.html">warp_drive.utils package</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="warp_drive.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="warp_drive.html#module-warp_drive.env_cpu_gpu_consistency_checker">warp_drive.env_cpu_gpu_consistency_checker module</a></li>
<li class="toctree-l2"><a class="reference internal" href="warp_drive.html#module-warp_drive.env_wrapper">warp_drive.env_wrapper module</a></li>
<li class="toctree-l2"><a class="reference internal" href="warp_drive.html#module-warp_drive">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="example_envs.html">example_envs package</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">WarpDrive</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="modules.html">&lt;no title&gt;</a> &raquo;</li>
        
          <li><a href="warp_drive.html">warp_drive package</a> &raquo;</li>
        
          <li><a href="warp_drive.training.html">warp_drive.training package</a> &raquo;</li>
        
      <li>warp_drive.training.algorithms package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="_sources/warp_drive.training.algorithms.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="warp-drive-training-algorithms-package">
<h1>warp_drive.training.algorithms package<a class="headerlink" href="#warp-drive-training-algorithms-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-warp_drive.training.algorithms.a2c">
<span id="warp-drive-training-algorithms-a2c-module"></span><h2>warp_drive.training.algorithms.a2c module<a class="headerlink" href="#module-warp_drive.training.algorithms.a2c" title="Permalink to this headline">¶</a></h2>
<p>The Advantage Actor-Critic Class
<a class="reference external" href="https://arxiv.org/abs/1602.01783">https://arxiv.org/abs/1602.01783</a></p>
<dl class="py class">
<dt class="sig sig-object py" id="warp_drive.training.algorithms.a2c.A2C">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">warp_drive.training.algorithms.a2c.</span></span><span class="sig-name descname"><span class="pre">A2C</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">discount_factor_gamma</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">normalize_advantage</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">normalize_return</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vf_loss_coeff</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.01</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">entropy_coeff</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.01</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#warp_drive.training.algorithms.a2c.A2C" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="py method">
<dt class="sig sig-object py" id="warp_drive.training.algorithms.a2c.A2C.compute_loss_and_metrics">
<span class="sig-name descname"><span class="pre">compute_loss_and_metrics</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">actions_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rewards_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">done_flags_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">probabilities_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value_function_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#warp_drive.training.algorithms.a2c.A2C.compute_loss_and_metrics" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-warp_drive.training.algorithms.ppo">
<span id="warp-drive-training-algorithms-ppo-module"></span><h2>warp_drive.training.algorithms.ppo module<a class="headerlink" href="#module-warp_drive.training.algorithms.ppo" title="Permalink to this headline">¶</a></h2>
<p>The Proximal Policy Optimization Class
<a class="reference external" href="https://arxiv.org/abs/1707.06347">https://arxiv.org/abs/1707.06347</a></p>
<dl class="py class">
<dt class="sig sig-object py" id="warp_drive.training.algorithms.ppo.PPO">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">warp_drive.training.algorithms.ppo.</span></span><span class="sig-name descname"><span class="pre">PPO</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">discount_factor_gamma</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">clip_param</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">normalize_advantage</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">normalize_return</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vf_loss_coeff</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.01</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">entropy_coeff</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.01</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#warp_drive.training.algorithms.ppo.PPO" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="py method">
<dt class="sig sig-object py" id="warp_drive.training.algorithms.ppo.PPO.compute_loss_and_metrics">
<span class="sig-name descname"><span class="pre">compute_loss_and_metrics</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">actions_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rewards_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">done_flags_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">probabilities_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value_function_batch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#warp_drive.training.algorithms.ppo.PPO.compute_loss_and_metrics" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-warp_drive.training.algorithms">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-warp_drive.training.algorithms" title="Permalink to this headline">¶</a></h2>
</div>
</div>


           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="warp_drive.training.models.html" class="btn btn-neutral float-right" title="warp_drive.training.models package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="warp_drive.training.html" class="btn btn-neutral float-left" title="warp_drive.training package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2021, Tian Lan, Sunil Srinivasa, Stephan Zheng.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>